using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class Customer_index : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlDataReader dr = ProjectUtility.executeQueryReader("select * from Users where username = '" + TextBox1.Text + "' and password = '" + TextBox2.Text + "'");

        if (dr.Read())
        {
            Session["username"] = TextBox1.Text;
            Session["role"] = dr.GetString(6);
            Response.Redirect("index.aspx");
        }
        else
        {
            Response.Redirect("fail.aspx");
        }
    }
}
